package com.proxy.staticProxy;

import com.proxy.service.SmsService;
import com.proxy.service.SmsServiceImpl;

public class StaticProxy implements SmsService {
    private SmsService smsService;

    public StaticProxy(SmsService smsService) {
        this.smsService = smsService;
    }

    public void send(String msg) {
        System.out.println("发短信前的操作");
        this.smsService.send(msg);
        System.out.println("发完短信后的操作");
    }

    public static void main(String[] args) {
        StaticProxy staticProxy = new StaticProxy(new SmsServiceImpl());
        staticProxy.send("短信内容！");
    }
}
